package com.ruoyi.user.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.user.mapper.MemberConfigMapper;
import com.ruoyi.user.domain.MemberConfig;
import com.ruoyi.user.service.IMemberConfigService;

/**
 * 会员设置Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-04-10
 */
@Service
public class MemberConfigServiceImpl implements IMemberConfigService 
{
    @Autowired
    private MemberConfigMapper memberConfigMapper;

    /**
     * 查询会员设置
     * 
     * @param id 会员设置主键
     * @return 会员设置
     */
    @Override
    public MemberConfig selectMemberConfigById(Long id)
    {
        return memberConfigMapper.selectMemberConfigById(id);
    }

    /**
     * 查询会员设置列表
     * 
     * @param memberConfig 会员设置
     * @return 会员设置
     */
    @Override
    public List<MemberConfig> selectMemberConfigList(MemberConfig memberConfig)
    {
        return memberConfigMapper.selectMemberConfigList(memberConfig);
    }

    /**
     * 新增会员设置
     * 
     * @param memberConfig 会员设置
     * @return 结果
     */
    @Override
    public int insertMemberConfig(MemberConfig memberConfig)
    {
        memberConfig.setCreateTime(DateUtils.getNowDate());
        return memberConfigMapper.insertMemberConfig(memberConfig);
    }

    /**
     * 修改会员设置
     * 
     * @param memberConfig 会员设置
     * @return 结果
     */
    @Override
    public int updateMemberConfig(MemberConfig memberConfig)
    {
        memberConfig.setUpdateTime(DateUtils.getNowDate());
        return memberConfigMapper.updateMemberConfig(memberConfig);
    }

    /**
     * 批量删除会员设置
     * 
     * @param ids 需要删除的会员设置主键
     * @return 结果
     */
    @Override
    public int deleteMemberConfigByIds(Long[] ids)
    {
        return memberConfigMapper.deleteMemberConfigByIds(ids);
    }

    /**
     * 删除会员设置信息
     * 
     * @param id 会员设置主键
     * @return 结果
     */
    @Override
    public int deleteMemberConfigById(Long id)
    {
        return memberConfigMapper.deleteMemberConfigById(id);
    }
}
